interface SatelliteData {
  name: string
  satnum: string
  Launchdate: string
  period: number
  position: GeoPosition
  satelliteItem: Satellite | null
}

export const useSatelliteStore = defineStore('satellite-store', {
  state: (): { satelliteInfo: SatelliteData } => ({
    satelliteInfo: {
      name: '',
      satnum: '',
      Launchdate: '',
      period: 0,
      position: {
        longitude: 0,
        latitude: 0,
        height: 0
      },
      satelliteItem: null
    }
  }),
  actions: {
    setSatelliteData(newDate: SatelliteData) {
      this.satelliteInfo = newDate
    }
  },
  persist: {
    storage: localStorage
  }
})
